function mainInit(){
var CC=$js().CC;
if(!CC.User.supportOAB){
$("liOAB").style.display="none";
}
if(!CC.User.supportPAB){
$("liPAB").style.display="none";
}
if(!CC.User.supportNetfolder){
$("liNF").style.display="none";
}
if(!CC.User.supportCalendar){
$("liCAL").style.display="none";
}
for(var i=0,li;li=$("liContainer").getElementsByTagName("LI")[i];i++){
if(li.className.indexOf("disabled")==-1){
li.onmouseover=function(){
addClass(this,"over");
};
li.onmouseout=function(){
delClass(this,"over");
delClass(this,"down");
};
li.onmousedown=function(){
addClass(this,"down");
};
li.onmouseup=function(){
delClass(this,"down");
};
}
}
$("divHSpliiter1").onmousedown=$("divHSpliiter2").onmousedown=hSplit;
document.onclick=function(e){
fHideMenu();
fSetSelectAble(e);
};
document.onmousedown=function(e){
fSetSelectAble(e);
};
document.onmousemove=document_mousemove;
document.onmouseup=document_mouseup;
}
function fGoto(){
fHideMenu();
fGoto0.apply(null,arguments);
}
function fGoto0(){
var _5=arguments;
if(_5[0]){
try{
var s="$js()."+_5[0]+"(";
for(var i=1;i<_5.length;i++){
if(i>1){
s+=",";
}
s+="arguments["+i+"]";
}
s+=");";
eval(s);
}
catch(e){
$js().fDebug("gmain -> "+_5[0],e);
}
}
}
function fGoto1(){
fGoto.apply(null,arguments);
var e=window.event||fGoto1.caller.arguments[0];
if(e){
fStop(e);
}
}
function fSearchMore(_9,_a){
fHideMenu();
var o=[{width:115,top:fGetY(_9)+_9.offsetHeight+1,left:fGetX(_9)}];
o[1]=[$js().gLang.searchmail.title,$js().fModuleExecute.bind(null,"searchmail")];
$js().CMenu.create(o);
fStop(_a);
}
function fStop(_c){
$js().Event.stop(_c);
}
function fSearchMail(){
var _d=$("txtKeyWord");
_d.blur();
var _e=fTrim(_d.value);
var _f=$js().gLang;
if(_e==""){
$js().UI.alert(_f.searchmail.msg["msg_nokeyword"]);
}else{
$js().CM.searchByKeyword(_e);
}
}
function fBlurSearch(o){
if(fTrim(o.value)==""){
o.value=o.defaultValue;
}
}
function fResetSearch(o){
o.value="";
}
function fSearchKeyPress(e){
if(document.all){
e=window.event;
}
if(e.keyCode==13){
fSearchMail();
return false;
}
return true;
}
function fTrim(s){
return s.replace(/(^\s*)|(\s*$)/g,"");
}
function fHideMenu(){
if(window.CMenu){
CMenu.hide();
}
var _14=$js();
var _15=_14.GE.laterRequestModule;
if(_15.indexOf("compose")>-1){
var _16=$("div"+_15).getElementsByTagName("IFRAME")[0];
if(_16&&window.frames[_16.name].fHideMenu){
window.frames[_16.name].fHideMenu();
}
_14.f_SetDivDisplay(_14.MM[_15].index);
}
}
function $(id){
return document.getElementById(id);
}
function fSaveObj(_18,_19){
$js().GE.oThis=_18;
$js().GE.oEvent=_19;
}
function fToggle(){
for(var i=0;i<arguments.length;i++){
var _1b=null;
if(typeof (arguments[i])=="object"){
_1b=arguments[i];
}else{
_1b=$(arguments[i]);
}
if(_1b){
_1b.style.display=(_1b.style.display=="none"?"":"none");
}
}
}
var currentDropFolder=null;
var isHSplitterMove=false;
var isVSplitterMove=false;
var moveObj=null;
function fGetX(_1c){
var l=_1c.offsetLeft;
while(_1c=_1c.offsetParent){
l+=_1c.offsetLeft;
}
return l;
}
function fGetY(_1e){
var t=_1e.offsetTop;
while(_1e=_1e.offsetParent){
t+=_1e.offsetTop;
}
return t;
}
function hSplit(ev){
isHSplitterMove=true;
if(document.all){
ev=event;
}
var _21=$("divHSpliiter1");
var _22=$("divHSpliiter2");
var _23=$("dvLeftTop");
var _24=$("dvLeftBottom");
var _25=$("dvTop");
this.downX=parseInt(ev.clientX,10);
var h=parseInt(_23.offsetHeight,10)+parseInt(_24.offsetHeight,10)+5;
var div=document.createElement("DIV");
this.moveItem=div;
div.style.height=h+"px";
div.style.width="6px";
div.style.position="absolute";
div.style.top=parseInt(_25.offsetHeight,10);
div.style.left=this.style.left;
div.style.backgroundColor="#888888";
div.style.zIndex=999;
document.body.appendChild(div);
if(document.all){
var dw=div.offsetWidth;
var dh=div.offsetHeight;
var _2a=document.body;
if(!_2a){
return;
}
var _2b=div.cloneNode(false);
_2b.style.zIndex="998";
_2b.style.margin="0px";
_2b.style.padding="0px";
_2b.style.border="none";
_2b.innerHTML="<iframe width='"+dw+"' height='"+dh+"' frameborder='0'></iframe>";
_2a.insertBefore(_2b,_2a.firstChild);
this._underDiv=_2b;
}
if(!this.layerItem){
with($js()){
var _2c=GE.laterRequestModule;
if(MM[_2c].isFolder&&MM[_2c].div.getElementsByTagName("IFRAME").length!=0){
this.layerItem=fGetContentLayer(MM[_2c].p3_2);
}
}
}
moveObj=this;
}
function vSplit(ev){
isVSplitterMove=true;
if(document.all){
ev=event;
}
this.downY=parseInt(ev.clientY,10);
var h=parseInt(this.offsetHeight,10);
var w=parseInt(this.offsetWidth,10);
var div=document.createElement("DIV");
document.body.appendChild(div);
this.moveItem=div;
div.style.height="6px";
div.style.width=w+"px";
div.style.backgroundColor="#888888";
div.style.position="absolute";
div.style.top=fGetY(this)+"px";
div.style.left=fGetX(this)+"px";
div.style.zIndex=99;
div.innerHTML="<b></b>";
if(!this.layerItem){
with($js()){
if(MM[GE.currentFolder].div.getElementsByTagName("IFRAME").length!=0){
this.layerItem=fGetContentLayer(MM[GE.currentFolder].p3_2);
}
}
}
moveObj=this;
vSplitterMove(0);
}
function fSetSelectAble(e){
if(document.all){
var _32=event.srcElement;
}else{
var _32=e.target;
}
if((_32.tagName!=null)&&(_32.tagName.toUpperCase()=="INPUT"||_32.tagName.toUpperCase()=="SELECT"||_32.tagName.toUpperCase()=="TEXTAREA"||fCheckBelongTo(_32,["spnReadArea","dvSignListContent","bUID","divTipMsg"]))){
document.body.onselectstart=function(){
return true;
};
}else{
document.body.onselectstart=function(){
return false;
};
}
}
function document_mousemove(ev){
if(document.all){
ev=event;
}
if(isHSplitterMove){
var x=parseInt(ev.clientX,10);
moveObj.moveItem.style.left=x-5+"px";
if(moveObj._underDiv){
moveObj._underDiv.style.left=moveObj.moveItem.style.left;
}
document.body.onselectstart=function(){
return false;
};
}
if(isVSplitterMove){
var y=ev.clientY;
moveObj.moveItem.style.top=parseInt(y,10)-5+"px";
document.body.onselectstart=function(){
return false;
};
return;
}
var f=$js();
if(f.gBeginMoving){
try{
var obj=f.gSourceDiv;
var GE=f.GE;
var El=f.El;
var top=ev.clientY-obj.mouseDownY;
var _3b=ev.clientX-obj.mouseDownX;
var iX=ev.clientX;
var iY=ev.clientY;
var _3e=$("dvDragItem");
var _3f=$("moveIcon");
if(Math.abs(top)>10||Math.abs(_3b)>10){
if(_3e.style.display=="none"){
_3e.style.display="";
}
_3e.style.top=iY+18;
_3e.style.left=iX+12;
}
if(_3f.isNoDrop&&_3f.className!="icoBtn4 btnS btnNoMov"){
_3f.className="icoBtn4 btnS btnNoMov";
}else{
if(!_3f.isNoDrop&&_3f.className!="icoBtn4 btnS btnMov"){
_3f.className="icoBtn4 btnS btnMov";
}
}
}
catch(exp){
}
}
}
function document_mouseup(ev){
if(document.all){
ev=event;
}
var _41=window.$js().gBeginMoving;
var MM=window.$js().MM;
var GE=window.$js().GE;
var UI=window.$js().UI;
var _45=window.$js().gLang;
if(isHSplitterMove){
isHSplitterMove=false;
if(moveObj._underDiv){
moveObj._underDiv.removeNode(true);
}
moveObj.moveItem.parentNode.removeChild(moveObj.moveItem);
if(GE.isFullDisplay){
UI.alert(_45.GLOBAL["msg_dragwhenfullscreen"]);
return;
}
var x=parseInt(ev.clientX,10)-moveObj.downX;
fHSplitterMove(x);
document.body.onselectstart=function(){
return true;
};
var _47=moveObj.layerItem;
if(_47){
_47.style.display="none";
moveObj.layerItem=null;
}
}
if(isVSplitterMove){
isVSplitterMove=false;
var y=parseInt(ev.clientY,10)-moveObj.downY;
vSplitterMove(y);
document.body.onselectstart=function(){
return true;
};
document.body.style.cursor="default";
var _49=moveObj.moveItem;
var _47=moveObj.layerItem;
_49.style.display="none";
_49.parentNode.removeChild(_49);
if(_47){
_47.style.display="none";
moveObj.layerItem=null;
}
}
if(_41){
window.$js().gBeginMoving=false;
var _4a=$("dvDragItem");
_4a.style.display="none";
_4a.parentNode.removeChild(_4a);
var _47=$("layerItem");
if(_47){
_47.style.display="none";
}
if(!currentDropFolder){
return;
}
fSetNameClass(currentDropFolder,"fbk3");
if(currentDropFolder.id.indexOf("nf")>-1){
MM["folder"].folderDop(currentDropFolder.id.replace("lnk",""));
currentDropFolder=null;
}else{
MM[GE.currentFolder].folderDop(currentDropFolder.id.replace("lnk",""));
currentDropFolder=null;
}
}
try{
var _4b=document.all?ev.srcElement:ev.target;
if((_4b.type&&_4b.type.toUpperCase()=="TEXT")||_4b.tagName.toUpperCase()=="SELECT"||_4b.tagName.toUpperCase()=="TEXTAREA"){
return true;
}
with(window.$js()){
var _4c=GE.laterRequestModule;
if(_4c.indexOf("compose")>-1){
f_SetDivDisplay(MM[_4c].index);
}
if(MM[_4c].isFolder&&MM[_4c].div&&MM[_4c].div.style.display!="none"){
if(!document.all&&_4b.id.indexOf("dgData")>-1){
}else{
MM[GE.laterRequestModule].focus();
}
}
}
}
catch(exp){
}
}
function fHSplitterMove(_4d){
try{
if(isNaN(_4d)){
return;
}
var CC=$js().CC;
var GE=$js().GE;
var UI=$js().UI;
var _51=$("dvLeftTop");
var _52=$("dvLeftBottom");
var _53=$("dvRightTop");
var _54=$("dvRightBottom");
var _55=$("divHSpliiter1");
var _56=$("divHSpliiter2");
var _57=Math.max(GE.bodyWidth,750);
var _58=parseInt(_52.style.width,10)+_4d;
if(_58<200){
_4d+=200-_58;
_58=200;
}
if(_58>_57-550){
_4d+=_57-550-_58;
_58=_57-550;
}
var _59=parseInt(_51.offsetWidth,10)+_4d,rMarginLeft=parseInt(_53.style.marginLeft,10)+_4d,splitterLeft1=parseInt(_55.style.left,10)+_4d,splitterLeft2=parseInt(_56.style.left,10)+_4d;
if(_59<0||rMarginLeft<0||splitterLeft1<0||splitterLeft2<0){
return;
}
_51.style.width=_59+"px";
_52.style.width=_58+"px";
_53.style.marginLeft=_54.style.marginLeft=rMarginLeft+"px";
_55.style.left=splitterLeft1+"px";
_56.style.left=splitterLeft2+"px";
_54.style.width=(_57-_58-12)+"px";
$("dvHide1").style.width=(_57-6)+"px";
if(GE.laterRequestModule){
$js().MM[GE.laterRequestModule].resize();
}
UI.Tab.size(_53.offsetWidth-150);
var con="con_left_width";
GE.localConfig[con]=_59-230;
CC.setCookie(con,GE.localConfig[con]);
}
catch(exp){
}
}
function vSplitterMove(y){
if(isNaN(y)){
return;
}
var f=$js();
var GE=f.GE;
var MM=f.MM;
var CC=f.CC;
var El=f.El;
with(MM[GE.currentFolder]){
var h=p1.getH();
var h1=p3.getH();
var h2=p1_2.getH();
if(!GE.IsIE){
p3_2.style.height="";
}
var h3=p3_2.getH();
if(h3-y<60){
y=h3-60;
}else{
if(h2+y<60){
y=60-h2;
}else{
if(h1-y<100){
y=h1-100;
}
}
}
var y1=h2+y,y2=h+y,y3=h3-y,y4=h1-y;
if(y1<0||y2<0||y3<0||y4<0){
return;
}
p1_2.setH(y1);
resize();
}
if(!MM["folder"].bottomInit){
var con="con_bottom_height";
if(GE.localConfig[con]){
GE.localConfig[con]+=y;
}else{
GE.localConfig[con]=y;
}
CC.setCookie(con,GE.localConfig[con]);
}
MM["folder"].bottomInit=false;
if(!moveObj||!moveObj.layerItem){
return;
}
var _67=MM[GE.currentFolder].p3_2;
var div=moveObj.layerItem;
El.setStyle(div,{"display":"block","position":"absolute","zIndex":"99","width":_67.offsetWidth+"px","height":_67.getH()+"px","top":El.getY(_67)+"px","left":El.getX(_67)+"px"});
}
function setClass(o,s){
o.className=s;
}
function addClass(o,s){
if(o.className==s){
return;
}
if(o.className.indexOf(" "+s)!=-1){
return;
}
o.className+=" "+s;
}
function delClass(o,s){
if(o.className.substring(0,s.length)==s){
o.className=o.className.substring(s.length);
}
o.className=o.className.replace(" "+s,"");
}
function fButtonMenu(o,e,_71){
$js().fButtonMenu(o,e,_71);
}
function fToggleReadMore(id,_73,obj){
var MM=$js().MM;
var El=$js().El;
with(MM[_73]){
var h1=p3_1.getH();
var h2=p3_2.getH();
fToggle(id);
var h3=p3_1.getH();
var h4=h2-(h3-h1);
if(h4<50){
var y=50-h4;
vSplitterMove(0-y);
}
if(MM[_73].isFolder){
var h=p3.getH()-p3_1.getH()-7;
p3_2.setH(h);
p3_2_1.setH(h);
}else{
p3_2.setH(h4);
p3_2_1.setH(h4);
}
}
if(obj.className.indexOf("icoDown")>-1){
El.removeClass(obj,"icoDown");
El.addClass(obj,"icoUp");
}else{
El.removeClass(obj,"icoUp");
El.addClass(obj,"icoDown");
}
MM[_73].resize();
}
function fGetContentLayer(_7d){
var El=$js().El;
var CC=$js().CC;
var div=$("layerItem");
if(div){
div.parentNode.removeChild(div);
}
div=El.createElement("DIV");
div.id="layerItem";
if(_7d){
El.setStyle(div,{"display":"block","position":"absolute","zIndex":"99","width":_7d.offsetWidth+"px","height":_7d.getH()+"px","top":El.getY(_7d)+"px","left":El.getX(_7d)+"px"});
}
div.innerHTML="<img src=\""+CC.getURL("images/place.gif")+"\" width=\"100%\" height=\"100%\">";
document.body.appendChild(div);
return div;
}
function fFolderOver(obj){
if(obj==null){
return;
}
if(obj.tagName.toUpperCase()!="A"){
obj=obj.getElementsByTagName("A")[0];
}
var f=$js();
if(!f.gBeginMoving||obj.id.indexOf(f.GE.currentFolder)>-1||obj.id.indexOf("@")>-1){
return;
}
fSetNameClass(obj,"bgcolor3 fw");
$("moveIcon").isNoDrop=false;
currentDropFolder=obj;
}
function fFolderOut(obj){
if(obj==null){
return;
}
if(obj.tagName.toUpperCase()!="A"){
obj=obj.getElementsByTagName("A")[0];
}
var f=$js();
if(!f.gBeginMoving||obj.id.indexOf(f.GE.currentFolder)>-1||obj.id.indexOf("@")>-1){
return;
}
fSetNameClass(obj,"fbk3");
$("moveIcon").isNoDrop=true;
currentDropFolder=null;
}
function fSetNameClass(obj,_86){
if(obj.className.indexOf("btnName")!=-1){
obj.className="btnName "+_86;
}else{
obj.className="lstName "+_86;
}
}
function $js(){
return parent.frames["jsFrame"];
}
function fBelongTo(obj,id){
if(obj.id==id){
return true;
}else{
if(obj.parentNode){
return fBelongTo(obj.parentNode,id);
}else{
return false;
}
}
}
function fCheckBelongTo(obj,arr){
for(var i=0;i<arr.length;i++){
if(fBelongTo(obj,arr[i])){
return true;
}
}
return false;
}
window.onload=function(){
document.body.oncontextmenu=function(){
if(!document.all){
return false;
}
};
};
function wObserve(_8c,_8d){
window["on"+_8c]=_8d;
}

